<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>广告管理-{$site.SITE_INFO.name}</title>
    <php>
        $addCss="";
        $addJs="";
        $currentNav ='广告管理 > 广告列表';
    </php>
    <include file="Common:intoHead" />
</head>
<body>
<div class="wrap">
    <include file="Common:head" />
    <div class="mainBody">
        <include file="Common:left" />
        <div id="Right">
            <div class="Item hr">
                <div class="current" style="max-width: 100px; float: left;">广告列表</div>
                <div style="width: 100px;float: right;"><button type="button" class="btn" onclick="window.location.href='{:U('Siteinfo/add_ad')}'">添加</button></div>
            </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
                <thead>
                <tr>
                    <td width="5%">排序</td>
                    <td width="12%">广告标题</td>
                    <td width="38%">链接地址</td>
                    <td width="24%">图片</td>
                    <td width="15%">操作</td>
                </tr>
                </thead>
                <volist name="list" id="vo">
                    <tr align="center" id="{$vo.id}">
                        <td align="left">{$vo.sort}</td>
                        <td>{$vo.ad_name}</td>
                        <td>{$vo.ad_link}</td>
                        <td><img src="__UPLOAD__/picture/{$vo.ad_img}" border="0" height="40" width="200"></td>
                        <td>[ <a href="{:U('Siteinfo/add_ad/',array('id'=>$vo['id']))}">编辑 </a> ] [ <a link="{:U('Siteinfo/delad/',array('id'=>$vo['id']))}" href="javascript:void(0)" name="{$vo.ad_name}" class="del">删除 </a> ]</td>
                    </tr>
                </volist>
                <tr><td colspan="6" align="right">{$page}</td></td></tr>
            </table>
        </div>
    </div>
</div>
<div class="clear"></div>
<include file="Common:foot" />
<script type="text/javascript">
    $(function(){
        $(".del").click(function(){
            var delLink=$(this).attr("link");
            $this = $(this);
            popup.confirm('你真的打算删除【<b>'+$(this).attr("name")+'</b>】吗?','温馨提示',function(action){
                if(action == 'ok'){
                    delByLink(delLink,$this);
                }
            });
            return false;
        });
    });
</script>
</body>
</html>